#ifndef __EE_GAMESTATEBASE_HPP
#define __EE_GAMESTATEBASE_HPP

#include <SFML/Graphics.hpp>

namespace EE
{
	class GameEngine;

	class GameStateBase
	{
		public:
			GameStateBase(GameEngine *engine) :
				game(engine)
			{
				elapsedTimer.Reset();
				pausedTimer.Reset();
				isPaused = true;
			}
			virtual void Process(sf::Event event)=0;
			virtual void Update()=0;
			virtual void UpdateTimed(unsigned long time)=0;
			virtual void Render()=0;
			void Pause()
			{
				isPaused = true;
				elapsedTime += elapsedTimer.GetElapsedTime();
				elapsedTimer.Reset();
				pausedTimer.Reset();
			}
			void Activate()
			{
				isPaused = false;
				pausedTime += pausedTimer.GetElapsedTime();
				pausedTimer.Reset();
				elapsedTimer.Reset();
			}
			GameEngine *game;
		protected:
			sf::Clock pausedTimer;
			sf::Clock elapsedTimer;
			unsigned long pausedTime;
			unsigned long elapsedTime;
			bool isPaused;
	};
}

#endif
